// 封装组织架构api

import request from '@/utils/request.js'

// 获取部门列表
export function getDepartmentList() {
  return request({
    url: '/company/department'
  })
}

// 获取部门负责人
export function getDeptManager() {
  return request({
    url: '/sys/user/simple'
  })
}

// 新增部门
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 获取部门详情通过部门id
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 编辑部门
export function updateDepartment(data, id) {
  return request({
    url: `/company/department/${id}`,
    method: 'PUT',
    data
  })
}

// 删除部门
export function deleteDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
